import greenfoot.*;  // (World, Actor, GreenfootImage, Greenfoot and MouseInfo)

/**
 * Write a description of class Barco here.
 * 
 * @author (your name) 
 * @version (a version number or a date)
 */
public class Barco extends Actor
{
    /**
     * Act - do whatever the Barco wants to do. This method is called whenever
     * the 'Act' or 'Run' button gets pressed in the environment.
     */
    private GreenfootImage Barco1 = new GreenfootImage("Barco1.png");
    private GreenfootImage Barco2= new GreenfootImage("Barco2.png");
    private int num;
    public void act() 
    {
        num++;
        if(num==15){setImage(Barco2);}
        if(num==30){setImage(Barco1);num=0;}
        // Add your action code here.
    }    
    public Barco(){
    num=0;
    setImage(Barco1);
    }
}
